#pragma once

#include <libtcod\libtcod.hpp>
#include <memory>
#include <functional>
#include <vector>

class InputManager;
typedef std::shared_ptr<InputManager> InputManagerPtr;

class InputManager
{
public:
	InputManager();
	~InputManager();

	bool handleKeys();
	void setKeyCallback(TCOD_keycode_t vk, uint8 pressed, std::function<void(TCOD_key_t)> callback);

private:
	class KeyCallback
	{
	public:
		TCOD_keycode_t vk;
		uint8 pressed;
		std::function<void(TCOD_key_t)> callback;
	};
	typedef std::shared_ptr<KeyCallback> KeyCallbackPtr;
	std::vector<KeyCallbackPtr> key_callbacks;
};
